
#include "Core/Math.hpp"

namespace SE
{
	class MeshInstance
	{
	public:
		virtual void onRender(const Matrix4f trannsform) = 0;

		virtual String record() = 0;
	};

	class BezierSurface : public MeshInstance
	{
	public:
		Vector3f mControlPoints[4][4] =
		{
			Vector3f{ -0.9f, 0.0f, -0.9f }, Vector3f{ -0.3f, 0.0f, -0.9f }, Vector3f{  0.3f, 0.0f, -0.9f }, Vector3f{  0.9f, 0.0f, -0.9f },
			Vector3f{ -0.9f, 0.0f, -0.3f }, Vector3f{ -0.3f, 0.0f, -0.3f }, Vector3f{  0.3f, 0.0f, -0.3f }, Vector3f{  0.9f, 0.0f, -0.3f },
			Vector3f{ -0.9f, 0.0f,  0.3f }, Vector3f{ -0.3f, 0.0f,  0.3f }, Vector3f{  0.3f, 0.0f,  0.3f }, Vector3f{  0.9f, 0.0f,  0.3f },
			Vector3f{ -0.9f, 0.0f,  0.9f }, Vector3f{ -0.3f, 0.0f,  0.9f }, Vector3f{  0.3f, 0.0f,  0.9f }, Vector3f{  0.9f, 0.0f,  0.9f }
		};

		virtual void onRender(const Matrix4f trannsform) override;
	
		virtual String record() override;

	private:
		Vector3f calculateCubicBezierPoint(Vector3f* ps, const Float t);
	};
} // !namespace SE